package com.itheima.edu.info.manager.day14;

import java.util.concurrent.CountDownLatch;

public class Test {
    public static void main(String[] args) {

        SemaphoreTest st=new SemaphoreTest();
        for (int i = 0; i < 100; i++) {
            new Thread(st).start();
        }




        // tt1Test();


        // atomicInteger();


       // chiJiaoZi();

    }



    private static void chiJiaoZi() {
        //计数器,计算几个人吃饺子
        CountDownLatch countDownLatch = new CountDownLatch(3);
        Ma m = new Ma(countDownLatch);
        new Thread(m).start();

        HaiZi1 h1 = new HaiZi1(countDownLatch);
        new Thread(h1).start();

        HaiZi2 h2 = new HaiZi2(countDownLatch);
        new Thread(h2).start();

        HaiZi3 h3 = new HaiZi3(countDownLatch);
        new Thread(h3).start();
    }

    private static void atomicInteger() {
        AtomicIntegerTest at = new AtomicIntegerTest();
        for (int i = 0; i < 1000; i++) {
            new Thread(at).start();
        }
    }

    private static void tt1Test() {
        tt1 t = new tt1();
        for (int i = 0; i < 100000; i++) {
            new Thread(t).start();
        }
    }
}
